@import "../import.less";
.mu-switch {
  position: relative;
  display: inline-block;
  height: 24px;
  line-height: 24px;
  cursor: pointer;
  user-select: none;
  outline: none;
  input[type="checkbox"] {
    display: none;
  }
  &.disabled {
    input[type="checkbox"]:checked{
      + .mu-switch-wrapper {
        .mu-switch-track{
          background-color: @trackColor;
        }
        .mu-switch-thumb{
          background-color: @grey300;
        }
      }
    }
  }

  * {
    pointer-events: none;
  }
  &.disabled  {
    cursor: not-allowed;
  }
}

.mu-switch-checked {
  color: @primaryColor;
  .mu-switch-track{
    background-color: currentColor;
    opacity: 0.5;
  }
  .mu-switch-thumb{
    background-color: currentColor;
    transform: translate3d(18px, 0, 0);
  }
}

.mu-switch-wrapper{
  display: flex;
  width: 100%;
  height: 24px;
  align-items: center;
  justify-content: space-between;
}

.mu-switch-container{
  width: 38px;
  padding: 4px 0px 4px 2px;
  position: relative;
  margin-right: 8px;
  .mu-switch.label-left &{
    margin-right: 0;
    margin-left: 8px;
  }
  .mu-switch.no-label &{
    margin-left: 0;
    margin-right: 0;
  }
}

.mu-switch-label {
  color: @textColor;
  .mu-switch.disabled & {
    color: @disabledColor;
  }
}

.mu-switch-track {
  width: 100%;
  height: 14px;
  border-radius: 30px;
  background-color: @trackColor;
  transition: all 450ms @easeOutFunction;
  .mu-switch.disabled & {
    background-color: @trackColor;
  }
}

.mu-switch-thumb {
  position: absolute;
  top: 1px;
  left: 0px;
  width: 20px;
  height: 20px;
  line-height: 24px;
  background-color: @backgroundColor;
  border-radius: 50%;
  .depth(1);
  transition: all 450ms @easeOutFunction;
  backface-visibility: hidden;
  .mu-switch.disabled & {
    background-color: @grey300;
  }
}

.mu-switch-ripple-wrapper {
  height: 200%;
  width: 200%;
  top: -10px;
  left: -10px;
  position: absolute;
}
